home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 28 / 028.d81 / guess number (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  3KB  |  107 lines

  1. 1 gosub60100
  2. 10 print"[147]          [199]uess [212]he [206]umber"
  3. 15 print"          [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  4. 20 ez$="e": print"[197]asy or [200]ard? [[197]/[200]]"
  5. 25 getez$:ifez$<>"e"andez$<>"h"then25
  6. 30 ez$=left$(ez$,1): if (ez$ = "[197]") then ez$ = "e"
  7. 40 hi = +100: lo = -100
  8. 50 if (ez$ = "e") then hi = 10: lo = 0
  9. 60 print "[199]uess [212]he [206]umber [198]rom " lo + 1 "to" hi
  10. 70 print "[208]ress [[210][197][212][213][210][206]] [215]hen [196]one."
  11. 80 n = rnd(0)*(hi - (lo)) + lo + .5
  12. 90 n = int( n * 10 ) / 10
  13. 100 if (ez$ = "e") then n = int(n)
  14. 110 gosub 10190
  15. 120 get k$: if k$ <> chr$(13)then 120
  16. 130 print"[212]he [193]nswer [201]s ";n
  17. 140 print"[208]ress: [[193]] to guess another number."
  18. 141 print"       [[195]] to choose [197][193][211][217] or [200][193][210][196]."
  19. 142 print"       [[210]] to return to [204][207][193][196][211][212][193][210]."
  20. 145 getk$:ifk$=""then145
  21. 150 if k$ = "a" or k$="[193]" then 60
  22. 152 ifk$="c"ork$="[195]"then10
  23. 155 ifk$<>"r"andk$<>"[210]"then145
  24. 160 open15,8,15,"r0:hello connect=hello connect"
  25. 170 input#15,er:close15
  26. 180 ifer<>63thenend
  27. 190 printchr$(147):load"hello connect",8
  28. 10000 rem    blink the disk error light
  29. 10010 rem    nl number of times
  30. 10020 open 15,8,15
  31. 10030 if nl<1 then gosub 10140: gosub 10140: (NULL) to 230
  32. 10040 gosub 10140
  33. 10050 for jl=1 to nl
  34. 10060 :   for il=1 to lt
  35. 10070 :      print#15,"m-e"chr$(0)chr$(193)
  36. 10080 :   next il
  37. 10090 :   gosub 10140
  38. 10100 next jl
  39. 10110 close 15
  40. 10120 return
  41. 10130 rem    delay
  42. 10140 for il=1 to 20*lt
  43. 10150 next il
  44. 10160 return
  45. 10170 rem    divide number into decades
  46. 10180 rem    and send each digit out
  47. 10190 n$ = str$(n): nd = 0
  48. 10200 if len(n$) < 2 then 10300
  49. 10210 for kl=1 to len(n$)
  50. 10220 :   nn$ = mid$(n$,kl,1)
  51. 10230 :   if nn$=" " then 10290
  52. 10240 :   if nn$="-" then nl = 5: lt = 1: goto 10280
  53. 10250 :   if nn$="." then nd = 1: nl = 1: lt = 50: goto 10280
  54. 10260 :   nl = val(nn$): lt = 10
  55. 10270 :   if nl = 0  then nl = 1: lt = 2
  56. 10280 :   gosub 10020
  57. 10290 next kl
  58. 10300 if ez$<>"e" then: if nd = 0 then nl = 1: lt = 50: gosub 10020
  59. 10310 return
  60. 60100 pn$="[199]uess the [206]umber":an$="[194][217]:  [205]ichael [202]. [203]eryan"
  61. 60110 bo=11:sc=15:cl=06:c1=12:c2=00:c3=12:c4=00:c5=00:c6=02:c7=09
  62. 60120 rem bo - border color
  63. 60121 rem sc - screen color
  64. 60122 rem cl - color poked on border
  65. 60123 rem c1 - top box outside color
  66. 60124 rem c2 - top box inside color
  67. 60125 rem c3 - bottom box outside color
  68. 60126 rem c4 - bottom box inside color
  69. 60127 rem c5 - 'copyright' color
  70. 60128 rem c6 - 'program name' color
  71. 60129 rem c7 - 'authors name' color
  72. 60130 poke53280,bo:poke53281,sc:print"[147]";
  73. 60140 poke646,c1:print"  [164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
  74. 60150 poke646,c2:print"  [165]        [204][207][193][196][211][212][193][210] [208][210][197][211][197][206][212][211]:        [167]"
  75. 60170 poke646,c1:print"  [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]"
  76. 60180 poke646,c6:print""tab(20-len(pn$)/2);pn$
  77. 60190 poke646,c7:print""tab(20-len(an$)/2);an$
  78. 60200 poke646,c5:print""tab(13)"[195][207][208][217][210][201][199][200][212] 1986"
  79. 60210 printtab(9)"[195][207][205][205][207][196][207][210][197] [208][213][194][204][201][195][193][212][201][207][206][211]"
  80. 60220 poke646,c3:print"  [164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164]"
  81. 60230 poke646,c4:print"  [165]                                  [167]"
  82. 60240 poke646,c3:print"  [163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]":le=1044:ri=1043
  83. 60250 pokele,98:pokeri,98:le=le-1:ri=ri+1
  84. 60260 co=54272:pokeri+co,cl:pokele+co,cl
  85. 60270 ifle=1025then60290
  86. 60280 goto60250
  87. 60290 pokele,108:pokeri,123:pokele+co,cl:pokeri+co,cl:poke646,cl
  88. 60300 le=le+40:ri=ri+40:ifle=1985then60330
  89. 60305 ifle=1185thenprint"[183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183]"
  90. 60306 ifle=1825thenprint"[175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175][175]"
  91. 60310 pokele,225:pokeri,97:pokele+co,cl:pokeri+co,cl
  92. 60320 goto60300
  93. 60330 pokele,124:pokeri,126:pokele+co,cl:pokeri+co,cl
  94. 60340 le=le+1:ri=ri-1:ifle=2004thenpoke198,.:goto60360
  95. 60350 pokele,226:pokeri,226:pokele+co,cl:pokeri+co,cl:goto60340
  96. 60360 print"";
  97. 60370 poke646,c2:print"[165][208]ress the [[211][208][193][195][197] [194][193][210]] to continue.[167]"
  98. 60380 fora=1to100
  99. 60390 geta$:ifa$=" "ora$="[160]"thenreturn
  100. 60400 next
  101. 60410 print"";
  102. 60420 print"[165]                                  [167]"
  103. 60430 fora=1to100
  104. 60440 geta$:ifa$=" "ora$="[160]"thenreturn
  105. 60450 next
  106. 60460 goto60360
  107.